package com.arykow.engine.onwebapp.client.page;

import com.arykow.engine.onwebapp.client.ApplicationEntryPoint;
import com.arykow.engine.onwebapp.client.Feed;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;

public class FeedPage extends Composite {

	private static FeedPageUiBinder uiBinder = GWT.create(FeedPageUiBinder.class);

	interface FeedPageUiBinder extends UiBinder<Widget, FeedPage> {
	}

	private ApplicationEntryPoint applicationEntryPoint;

	public FeedPage(ApplicationEntryPoint applicationEntryPoint) {
		this.applicationEntryPoint = applicationEntryPoint;
		initWidget(uiBinder.createAndBindUi(this));
	}

	@UiField
	Label xmlUrlLabel;

	@UiField
	Anchor htmlUrlAnchor;

	public void update(Feed feed) {
		xmlUrlLabel.setText(feed.getXmlUrl());
		htmlUrlAnchor.setHref(feed.getHtmlUrl());
		htmlUrlAnchor.setText(feed.getText());
	}

}
